import { defineStore } from 'pinia';
import { store } from '@/store';

export const useNetworkStore = defineStore({
  id: 'app-network',
  state: () => ({
    // 网络状态，用于下载提醒
    networkState: 'unknown',
  }),
  getters: {
    getNetworkState(): any {
      return this.networkState;
    },
  },
  actions: {
    setNetworkState(provider) {
      this.networkState = provider;
    },
  },
});

export function useNetworkStoreWithOut() {
  return useNetworkStore(store);
}
